package com.template.app.task;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;


/**
 * 定时计划 
 */
@Component
@EnableScheduling
public class Schedule {
	private static Logger logger = LoggerFactory.getLogger(Schedule.class);
//	@Autowired
//	private PhoneVerService phoneVerService;
//origin	https://git.oschina.net/wxclass/wechart-server.git

    /**
     *每隔1个小时获取一次accesstoken
     * */
/*	@Scheduled(cron="* * 0/1  * * ? ")
	public void getWechartAccessToken() {
        logger.info("schedule clearCache begin...... ");
        try {
			logger.info("定时任务");
        	AccessToken accessToken = WechartUtil.getAccessToken();
        	logger.info("WeChart access_token 票据："+accessToken.getAccessToken());
        	logger.info("WeChart access_token 有效时间："+accessToken.getExpiresIn()+"s");
        	JsapiTicket jsapiTicket=WechartUtil.getJsapiTicket();
        	logger.info("WeChart jsapi_icket 请求结果："+jsapiTicket.getErrcode());
        	logger.info("WeChart jsapi_icket 请求结果："+jsapiTicket.getErrmsg());
        	logger.info("WeChart jsapi_icket 票据:"+jsapiTicket.getTicket());
        	logger.info("WeChart jsapi_icket 请求结果："+jsapiTicket.getExpiresIn());
        } catch (Exception e) {
            e.printStackTrace();
        }
        logger.info("schedule clearCache end ! ");
    }*/


}
